package com.xmtlxx.oms.mapper;

import com.xmtlxx.oms.domain.Property;
import com.xmtlxx.oms.domain.bo.PropertyBo;
import com.xmtlxx.oms.domain.vo.PropertyVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 财物Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-12
 */
public interface PropertyMapper extends BaseMapperPlus<PropertyMapper, Property, PropertyVo> {
    /**
     * 根据条件分页查询财物
     *
     * @param property 财物
     * @return Page Property
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "p.create_by"),
        @DataColumn(key = "deptName", value = "p.office_id"),
        @DataColumn(key = "userName", value = "p.create_by")
    })
    Page<PropertyVo> selectPagePropertyList(@Param("page") Page<Property> page,@Param("property") PropertyBo property);

    /**
     * 根据条件分页查询财物
     *
     * @param property 财物
     * @return Page Property
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "p.create_by"),
        @DataColumn(key = "deptName", value = "p.office_id"),
        @DataColumn(key = "userName", value = "p.create_by")
    })
    Page<PropertyVo> selectPagePropertyListNew(@Param("page") Page<Property> page,@Param("property") PropertyBo property);

    /**
     * 查询财物列表
     *
     * @param property 财物
     * @return 财物集合
     */
//    @DataPermission({
//        @DataColumn(key = "tenantName", value = "p.create_by"),
//        @DataColumn(key = "deptName", value = "s.dept_id"),
//        @DataColumn(key = "userName", value = "p.create_by")
//    })
    List<PropertyVo> selectPropertyList(@Param("property") PropertyBo property);

    PropertyVo selectPropertyVoByID(String id);

    PropertyVo selectPropertyVoByPno(String pno);

    PropertyVo selectPropertyVo(@Param("property") PropertyBo property);

    Property selectPropertyByPno(String pno);

    void updatePBRegisterTypeByNo(@Param("pno") String pno,@Param("type") String type,@Param("update") Long update);
}
